package com.mlog.njyjy.ndop.monitor.common.domain;

import com.jfinal.plugin.activerecord.Model;
import com.mlog.njyjy.ndop.monitor.common.support.Constants;
import com.mlog.njyjy.ndop.share.sql.annotation.Column;
import com.mlog.njyjy.ndop.share.sql.annotation.Id;
import com.mlog.njyjy.ndop.share.sql.annotation.Table;
import com.mlog.njyjy.ndop.share.sql.annotation.TableUnique;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 监控任务
 *
 * @author zyz
 * @version v1.0, 2020/07/24
 */
@Data
@Accessors(chain = true)
@Table(prefix = Constants.TBL_PRODUCT_MONITOR_PREFIX, uniques = {@TableUnique(columns = {"product_name", "start_proc_at"})}, comment = "监控任务表")
public class Task extends Model<Task> {

    @Id
    private int id;

    @Column(nullable = false, comment = "产品名称")
    private String productName;

    @Column(nullable = false, comment = "产品文件后缀")
    private String pdtFileExt;

    @Column(nullable = false, comment = "采集方式")
    private int collectWayId;

    @Column(nullable = false, comment = "开始处理时间")
    private LocalDateTime startProcAt;

    @Column(nullable = false, comment = "结束处理时间")
    private LocalDateTime endProcAt;

    @Column(nullable = false, comment = "业务通知时间")
    private LocalDateTime notifyAt;

    @Column(nullable = false, comment = "业务告警时间")
    private LocalDateTime alertAt;

    @Column(nullable = false, comment = "产品状态")
    private String productStatus = Constants.PRODUCT_STATUS_NOT_REACHED;

    /**
     * 创建时间
     */
    @Column(updatable = false)
    private LocalDateTime createAt;

    private LocalDateTime updateAt;

}
